import React from 'react';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import {
  Card,
  Button,
  Spin,
  Anchor,
  Row,
  Col,
  Table,
  Modal,
  Steps,
  Badge,
  Popover,
  Divider,
} from 'antd';
import { connect } from 'dva';
import router from 'umi/router';
import moment from 'moment';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import FooterToolbar from '@/components/FooterToolbar';
import DescriptionList from '@/components/DescriptionList';
import downloadFile, { getFileName } from '@/utils/utils';
import ProRecording from '@/pages/components/Problem/ProblemPage/ProRecording';
import HdlRemark from '@/pages/components/HdlRemark';

const { Step } = Steps;
const { Description } = DescriptionList;
const { Link } = Anchor;

@connect(({ addempdetailsend, loading }) => ({
  loading: loading.effects['addempdetailsend/fetchEmpDetail'],
  modalLoading: loading.effects['addempdetailsend/fetchPayDetail'],
  addempdetailsend,
}))
@Form.create()
class BasicForm extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      sendOrdAddTaskId: null,
      modalVisible: false,
      activeKey: '1',
    };
  }

  componentDidMount() {
    const {
      dispatch,
      location: { query },
    } = this.props;
    // 获取详情信息
    dispatch({
      type: 'addempdetailsend/fetchEmpDetail',
      payload: { sendOrdAddTaskId: query.sendOrdAddTaskId },
    });
    dispatch({
      type: 'addempdetailsend/controlNavnum',
      payload: {},
    });
    this.setState({ sendOrdAddTaskId: query.sendOrdAddTaskId, activeKey: query.activeKey || '1' });
  }

  componentWillUnmount() {
    const { dispatch } = this.props;
    const resetInfo = {
      sendOrdAddTaskId: null,
      responseSendOrdDetailDto: null, // 派单信息
      empInfoDto: null, // 员工联系
      pdInfoDtos: null, // 产品服务信息
      protInfoDto: null, // 协议信息
      addEmpDetSerDto: null, // 社保公积金信息
      assDetailDtoList: null, // 增加险种信息
      execStatusDto: null, // 执行状态
      dataDtos: null, // 材料信息
      addEmpDetContRecDto: null, // 联系记录
      handDto: null, // 办理备注
      probDets: null, // 问题记录
      payDetailList: [], // 明细详情
    };
    dispatch({
      type: 'addempdetailsend/updateModelData',
      payload: { ...resetInfo },
    });
  }

  // 材料信息（来自员工系统）
  getVal = value => {
    if (value.inpVal) {
      if (value.inpType && value.inpType === 9 && value.inpVal !== '[]') {
        return this.addLink(value.inpVal);
      }
      if (value.inpType && value.inpType === 9 && value.inpVal === '[]') {
        return '--';
      }
      return this.commanName(value);
    }
    return '--';
  };

  commanName = item => (item.inpVal ? item.inpVal : '--');

  addLink = matinfo =>
    matinfo.split(',').map(item => {
      const matinfoItem = item.split('|')[1];
      const matinfoName = getFileName(matinfoItem);
      return (
        <span key={item}>
          <a onClick={() => this.downLoad(item)}>{matinfoName}</a>
        </span>
      );
    });

  downLoad = item => {
    const file = item.split('|');
    downloadFile({ fileId: file[0], fileName: getFileName(file[1]) });
  };

  // 获取缴纳明细弹框
  getPayDetail = () => {
    const { dispatch } = this.props;
    const { sendOrdAddTaskId } = this.state;
    dispatch({
      type: 'addempdetailsend/fetchPayDetail',
      payload: { sendOrdAddTaskId },
    });
    this.handleModalVisible(true);
  };

  // 切换模态框：新增、修改
  handleModalVisible = flag => {
    this.setState({
      modalVisible: !!flag,
    });
  };

  render() {
    const {
      loading,
      addempdetailsend: {
        responseSendOrdDetailDto, // 派单信息
        empInfoDto, // 员工联系
        pdInfoDtos, // 产品服务信息
        protInfoDto, // 协议信息
        addEmpDetSerDto, // 社保公积金信息
        assDetailDtoList, // 增加险种信息
        execStatusDto, // 执行状态
        dataDtos, // 材料信息
        addEmpDetContRecDto, // 联系记录
        handDto, // 办理备注
        probDets, // 问题记录
        payDetailList, // 缴费明细
        navNum, // 导航总数
        coltFlag = 1, // 是否需要材料信息
      },
      modalLoading,
    } = this.props;
    const { modalVisible, activeKey } = this.state;
    const protInfoDtoList = (protInfoDto && [{ ...protInfoDto }]) || [];
    const pdColumns = [
      {
        title: '产品',
        dataIndex: 'pdName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
      },
      {
        title: '执行地',
        dataIndex: 'cityName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
      },
      {
        title: '业务开始日期',
        dataIndex: 'beginDate',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: beginDate => (beginDate && moment(beginDate).format('YYYY-MM-01')) || '--',
      },
      {
        title: '回单时间',
        dataIndex: 'returnDate',
        onHeaderCell: () => ({
          style: {
            fontWeight: 'bold',
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        onCell: () => ({
          style: {
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        render: val => (val && moment(val).format('YYYY-MM-DD HH:mm')) || '--',
      },
      {
        title: '修改说明',
        dataIndex: 'editDesc',
        onHeaderCell: () => ({
          style: {
            fontWeight: 'bold',
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        onCell: () => ({
          style: {
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        render: val => val || '--',
      },
    ];
    const protColumns = [
      {
        title: '协议名称',
        dataIndex: 'suppProtName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
      },
      {
        title: '接单方',
        dataIndex: 'sendSuppName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
      },
      {
        title: '服务产品',
        dataIndex: 'pdName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: (val, record) => (
          <Popover
            content={
              <div>
                <span>{record.fee}</span>
              </div>
            }
          >
            <div
              style={{
                width: '160px',
                overflow: 'hidden',
                textOverflow: 'ellipsis',
                whiteSpace: 'nowrap',
                cursor: 'pointer',
              }}
            >
              {val}
            </div>
          </Popover>
        ),
      },
      {
        title: '执行地',
        dataIndex: 'areaName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
      },
      {
        title: '价格',
        dataIndex: 'price',
        align: 'right',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => (val && parseFloat(val).toFixed(2)) || '--',
      },
    ];
    const insAccuColumns = [
      {
        title: '险种',
        dataIndex: 'assName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '缴费方式',
        dataIndex: 'payWayName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '缴费账户',
        dataIndex: 'accoName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '申报工资',
        dataIndex: 'decWage',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => (val && parseFloat(val).toFixed(2)) || '--',
      },
      {
        title: '政策组合',
        dataIndex: 'grpName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
    ];

    const addassColumns = [
      {
        title: '产品',
        dataIndex: 'assName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '执行地',
        dataIndex: 'areaName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '缴费方式',
        dataIndex: 'payWayName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '缴纳账户',
        dataIndex: 'accoPlcyName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '申报工资',
        dataIndex: 'decWage',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => (val && parseFloat(val).toFixed(2)) || '--',
      },
      {
        title: '社保组合',
        dataIndex: 'grpName',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '业务开始日期',
        dataIndex: 'begTime',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: begTime => (begTime && moment(begTime).format('YYYY-MM-01')) || '--',
      },
      {
        title: '回单时间',
        dataIndex: 'returnDate',
        onHeaderCell: () => ({
          style: {
            fontWeight: 'bold',
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        onCell: () => ({
          style: {
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        render: val => (val && moment(val).format('YYYY-MM-DD HH:mm')) || '--',
      },
      {
        title: '修改说明',
        dataIndex: 'editDesc',
        onHeaderCell: () => ({
          style: {
            fontWeight: 'bold',
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        onCell: () => ({
          style: {
            display: activeKey === '3' || activeKey === '4' ? 'table-cell' : 'none',
          },
        }),
        render: val => val || '--',
      },
    ];

    const payDetailColumns = [
      {
        title: '产品名称',
        dataIndex: 'assName',
        align: 'center',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
      {
        title: '业务开始日期',
        dataIndex: 'beginDate',
        align: 'center',
        sorter: (a, b) => new Date(b.beginDate) - new Date(a.beginDate),
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: begTime => (begTime && moment(begTime).format('YYYY-MM-01')) || '--',
      },
      {
        title: '业务结束日期',
        dataIndex: 'endDate',
        align: 'center',
        sorter: (a, b) => new Date(b.endDate) - new Date(a.endDate),
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => {
          if (val && val && moment(val).format('YYYY-MM-01')) {
            const start = val && moment(val).format('YYYY-MM-01');
            const end = moment(start)
              .add('month', 1)
              .add('days', -1)
              .format('YYYY-MM-DD');
            return end;
          }
          return '无';
        },
      },
      {
        title: '缴纳金额',
        dataIndex: 'payAmount',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '企业基数',
        dataIndex: 'entpBase',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => (val && parseFloat(val).toFixed(2)) || '--',
      },
      {
        title: '企业比例(%)',
        dataIndex: 'entpProp',
        align: 'center',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '企业附加(元)',
        dataIndex: 'entpAddnAmo',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '企业缴费',
        dataIndex: 'entpPay',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '个人基数',
        dataIndex: 'perBase',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '个人比例(%)',
        dataIndex: 'perProp',
        align: 'center',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '个人附加(元)',
        dataIndex: 'perAddnAmo',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '个人缴费',
        dataIndex: 'perPay',
        onHeaderCell: () => ({ style: { fontWeight: 'bold', textAlign: 'center' } }),
        onCell: () => ({ style: { textAlign: 'right' } }),
        render: val => val || (val === 0 ? 0 : null),
      },
      {
        title: '执行地区',
        dataIndex: 'cityName',
        align: 'center',
        onHeaderCell: () => ({ style: { fontWeight: 'bold' } }),
        render: val => val || '--',
      },
    ];

    const customDot = (dot, { status }) =>
      status === 'process' ? (
        <Popover placement="topLeft" arrowPointAtCenter>
          {dot}
        </Popover>
      ) : (
        dot
      );
    // 判断是否为空对象
    const isEmptyObj = obj => {
      if (obj) {
        return JSON.stringify(obj) === '{}';
      }
      return false;
    };

    const status = (item, leafDet) => {
      if (item.operLeafType === 4) {
        return leafDet.doneFlag === 3 ? 'success' : 'default';
      }
      return leafDet.doneFlag === 1 ? 'success' : 'default';
    };
    // 是否含有材料信息
    const isShowMat = () => {
      if (coltFlag) {
        if (String(coltFlag) === '1') {
          return dataDtos && dataDtos.length ? (
            <DescriptionList>
              {dataDtos.map(item => (
                <Description
                  key={item.matName}
                  term={item.matName}
                  style={{ wordBreak: 'break-all' }}
                >
                  {this.getVal(item)}
                </Description>
              ))}
            </DescriptionList>
          ) : (
            '暂无数据'
          );
        }
        return (
          <DescriptionList>
            <Description term="材料是否完整">不需要材料</Description>
          </DescriptionList>
        );
      }
      return true;
    };
    return (
      <Form>
        <PageHeaderWrapper>
          <Spin tip="Loading..." spinning={loading}>
            {navNum > '4' ? (
              <Anchor onClick={e => e.preventDefault()} targetOffset={50}>
                <Row type="flex" justify="space-around">
                  {responseSendOrdDetailDto && (
                    <Col>
                      <Link href="#sendinfo" title="派单信息" />
                    </Col>
                  )}
                  {empInfoDto && (
                    <Col>
                      <Link href="#basicinfo" title="员工信息" />
                    </Col>
                  )}
                  {pdInfoDtos && (
                    <Col>
                      <Link href="#pdinfo" title="产品服务信息" />
                    </Col>
                  )}
                  {protInfoDto && (
                    <Col>
                      <Link href="#protinfo" title="协议信息" />
                    </Col>
                  )}
                  {addEmpDetSerDto && (
                    <Col>
                      <Link href="#insaccuinfo" title="社保公积金信息" />
                    </Col>
                  )}
                  {assDetailDtoList && (
                    <Col>
                      <Link href="#addassinfo" title="增加险种信息" />
                    </Col>
                  )}
                  {execStatusDto && (
                    <Col>
                      <Link href="#runstatusinfo" title="执行状态" />
                    </Col>
                  )}
                  <Col>
                    <Link href="#materialinfo" title="材料信息" />
                  </Col>
                  {addEmpDetContRecDto && (
                    <Col>
                      <Link href="#contrecordinfo" title="联系记录" />
                    </Col>
                  )}
                  {handDto && (
                    <Col>
                      <Link href="#hdlRemark" title="办理备注" />
                    </Col>
                  )}
                  {probDets && (
                    <Col>
                      <Link href="#proRecording" title="问题记录" />
                    </Col>
                  )}
                </Row>
              </Anchor>
            ) : null}
            {/* 派单信息 */}
            {responseSendOrdDetailDto && (
              <Card title={<span style={{ fontWeight: 'bolder' }}>派单信息</span>} id="sendinfo">
                {(!isEmptyObj(responseSendOrdDetailDto) && (
                  <DescriptionList>
                    <Description term="客户名称">
                      {responseSendOrdDetailDto.custName || '--'}
                    </Description>
                    <Description term="商务合同">
                      {responseSendOrdDetailDto.custContName || '--'}
                    </Description>
                    <Description term="入职日期">
                      {(responseSendOrdDetailDto.entryDate &&
                        moment(responseSendOrdDetailDto.entryDate).format('YYYY-MM-DD')) ||
                        '--'}
                    </Description>
                    <Description term="是否入职联系">
                      {responseSendOrdDetailDto.conEmpFlagName || '--'}
                    </Description>
                    <Description term="业务部">
                      {responseSendOrdDetailDto.sendDepName || '--'}
                    </Description>
                    <Description term="业务员">
                      {responseSendOrdDetailDto.sendRespName || '--'}
                    </Description>
                    <Description term="接单方">
                      {responseSendOrdDetailDto.recvSuppName || '--'}
                    </Description>
                    {responseSendOrdDetailDto.hairOrdDate && (
                      <Description term="发单时间">
                        {(responseSendOrdDetailDto.hairOrdDate &&
                          moment(responseSendOrdDetailDto.hairOrdDate).format(
                            'YYYY-MM-DD HH:mm'
                          )) ||
                          '--'}
                      </Description>
                    )}
                  </DescriptionList>
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 员工信息 */}
            {empInfoDto && (
              <Card title={<span style={{ fontWeight: 'bolder' }}>员工信息</span>} id="basicinfo">
                {(!isEmptyObj(empInfoDto) && (
                  <DescriptionList>
                    <Description term="姓名">{empInfoDto.empName || '--'}</Description>
                    <Description term="证件类型">{empInfoDto.idTypeName || '--'}</Description>
                    <Description term="证件号">{empInfoDto.idCode || '--'}</Description>
                    <Description term="国籍">{empInfoDto.nationName || '--'}</Description>
                    <Description term="出生日期">
                      {(empInfoDto.birthDate &&
                        moment(empInfoDto.birthDate).format('YYYY-MM-DD')) ||
                        '--'}
                    </Description>
                    <Description term="性别">{empInfoDto.genderName || '--'}</Description>
                    <Description term="电话">{empInfoDto.mobile || '--'}</Description>
                    <Description term="员工邮箱">{empInfoDto.email || '--'}</Description>
                  </DescriptionList>
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 产品服务信息 */}
            {pdInfoDtos && (
              <Card title={<span style={{ fontWeight: 'bolder' }}>产品服务信息</span>} id="pdinfo">
                {(pdInfoDtos.length && (
                  <Table
                    dataSource={pdInfoDtos || []}
                    columns={pdColumns}
                    rowKey={(_, index) => index}
                    pagination={false}
                    style={{ maxWidth: 800 }}
                  />
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 协议信息 */}
            {protInfoDto && (
              <Card title={<span style={{ fontWeight: 'bolder' }}>协议信息</span>} id="protinfo">
                {(protInfoDtoList.length && (
                  <Table
                    dataSource={protInfoDtoList || []}
                    columns={protColumns}
                    rowKey={(_, index) => index}
                    pagination={false}
                  />
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 社保公积金信息 */}
            {addEmpDetSerDto && (
              <Card
                title={
                  <div style={{ position: 'relative' }}>
                    <span style={{ fontWeight: 900 }}>社保公积金信息</span>
                    <a
                      onClick={this.getPayDetail}
                      style={{ position: 'absolute', top: '0', right: '0', fontSize: '14px' }}
                    >
                      缴纳明细
                    </a>
                  </div>
                }
                id="insaccuinfo"
              >
                {(!isEmptyObj(addEmpDetSerDto) && (
                  // 暂不考虑五险合不合一
                  // (addEmpDetSerDto.insSetFlag === 1 ? (
                  //   <div>
                  //     <DescriptionList>
                  //       <Description term="社保申报工资">{empInfoDto.empName || '--'}</Description>
                  //       <Description term="单立户账户">{empInfoDto.idTypeName || '--'}</Description>
                  //       <Description term="社保账户">{empInfoDto.idCode || '--'}</Description>
                  //       <Description term="社保组合">{empInfoDto.nationName || '--'}</Description>
                  //       <Description term="缴费人员类别">
                  //         {empInfoDto.nationName || '--'}
                  //       </Description>
                  //       <Divider dashed />
                  //       <Description term="公积金申报工资">
                  //         {empInfoDto.genderName || '--'}
                  //       </Description>
                  //       <Description term="公积金缴费方式">{empInfoDto.mobile || '--'}</Description>
                  //       <Description term="公积金账户">{empInfoDto.email || '--'}</Description>
                  //       <Description term="公积金组合">{empInfoDto.email || '--'}</Description>
                  //     </DescriptionList>
                  //   </div>
                  // ) : (
                  <Table
                    dataSource={addEmpDetSerDto.detailSerDtos || []}
                    columns={insAccuColumns}
                    rowKey={(_, index) => index}
                    pagination={false}
                  />
                )) ||
                  // ))
                  '暂无数据'}
              </Card>
            )}

            {/* 新增险种信息 */}
            {assDetailDtoList && (
              <Card
                title={<span style={{ fontWeight: 'bolder' }}>增加险种信息</span>}
                id="addassinfo"
              >
                {(assDetailDtoList.length && (
                  <Table
                    dataSource={assDetailDtoList || []}
                    columns={addassColumns}
                    rowKey={(_, index) => index}
                    pagination={false}
                    style={{ width: 800 }}
                  />
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 执行状态 */}
            {execStatusDto && (
              <Card
                title={<span style={{ fontWeight: 'bolder' }}>执行状态</span>}
                id="runstatusinfo"
              >
                {(execStatusDto.leafList && execStatusDto.leafList.length && (
                  <Steps
                    progressDot={customDot}
                    style={{ width: '60%', margin: '0 auto', marginTop: 20 }}
                  >
                    {execStatusDto &&
                      execStatusDto.leafList.map(item => (
                        <Step
                          key={item.operLeafTypeName}
                          title={item.operLeafTypeName}
                          description={
                            !item.leafDetList.length ? (
                              `暂无${item.operLeafType === '3' ? '办理' : '申报'}内容`
                            ) : (
                              <div style={{ width: 400, fontSize: 12, textAlign: 'left' }}>
                                {item.leafDetList.map(leafDet => (
                                  <div key={leafDet.leafDetId}>
                                    <Badge
                                      status={status(item, leafDet)}
                                      text={
                                        <span style={{ lineHeight: '30px' }}>
                                          {leafDet.leafDetTypeName}&nbsp;
                                          <span style={{ color: '#999' }}>
                                            {leafDet.cityName ? `(${leafDet.cityName})` : ''}
                                          </span>
                                          &nbsp;:{leafDet.doneFlagName || '--'}
                                          <span
                                            style={{
                                              fontSize: '12px',
                                              color: '#999',
                                              marginLeft: 15,
                                            }}
                                          >
                                            {leafDet.operTime &&
                                              moment(leafDet.operTime).format('YYYY-MM-DD')}
                                          </span>
                                        </span>
                                      }
                                    />
                                    <br />
                                  </div>
                                ))}
                              </div>
                            )
                          }
                          status={item.doneFlag === 1 ? 'finish' : 'wait'}
                        />
                      ))}
                  </Steps>
                )) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 材料信息 */}
            <Card title={<span style={{ fontWeight: 'bolder' }}>材料信息</span>} id="materialinfo">
              {isShowMat()}
            </Card>

            {/* 联系记录 */}
            {addEmpDetContRecDto && (
              <Card
                title={<span style={{ fontWeight: 'bolder' }}>联系记录</span>}
                id="contrecordinfo"
              >
                {(addEmpDetContRecDto.length &&
                  addEmpDetContRecDto.map((item, index) => (
                    <div>
                      {index > 0 && <Divider dashed />}
                      <DescriptionList>
                        <Description term="联系方式">{item.contactInfo || '--'}</Description>
                        {item.contactInfo === '短信' || item.contactInfo === '电话' ? (
                          <Description term="联系电话">{item.contactMobile}</Description>
                        ) : (
                          <Description term="邮件">{item.email || '--'}</Description>
                        )}
                        <Description term="联系人">{item.contactPer || '--'}</Description>
                        <Description term="联系时间">{item.contactTime || '--'}</Description>
                        <Description term="联系内容">
                          <span dangerouslySetInnerHTML={{ __html: item.remark || '--' }} />
                        </Description>
                      </DescriptionList>
                    </div>
                  ))) ||
                  '暂无数据'}
              </Card>
            )}

            {/* 办理备注 */}
            {handDto && <HdlRemark hdlRemark={handDto} />}

            {/* 问题记录 */}
            {probDets && <ProRecording proRecording={probDets} />}

            <Modal
              width={1200}
              visible={modalVisible}
              onCancel={() => this.handleModalVisible(false)}
              title="社保公积金明细"
              footer={[
                <Button
                  key="submit"
                  type="primary"
                  loading={loading}
                  onClick={() => this.handleModalVisible(false)}
                >
                  关闭
                </Button>,
              ]}
            >
              <Table
                dataSource={payDetailList}
                columns={payDetailColumns}
                rowKey={(_, index) => index}
                loading={modalLoading}
                pagination={false}
              />
            </Modal>
            <FooterToolbar style={{ width: '100%' }}>
              <Button onClick={() => router.goBack()}>返回</Button>
            </FooterToolbar>
          </Spin>
        </PageHeaderWrapper>
      </Form>
    );
  }
}

const BasicFormList = Form.create()(BasicForm);
export default BasicFormList;
